{{extend 'layout.html'}}

<h2>Tradeble Products</h2>

<table width="80%">
  {{for row in rows:}}
  <tr>
    <td width="1px"><b>{{=row.name}}<b></td>
    <td width="200px">{{if form:}}[{{=A('edit',_href=URL('edit_product',args=row.id))}}]{{pass}}
    [{{=A('trade',_href=URL('trade',args=row.id))}}]
    [{{=A('profits/loss',_href=URL('pandl',args=row.id))}}]</td>
    <td>{{=(row.description or '')[:40]+'...'}}</td>
  </tr>
  {{pass}}
</table>

{{if form:}}
<br/><br/>
<h2>Register new product</h2>
<i>remember to start applications/modules/machingengine.py &lt;name&gt;</li>
{{=form}}
{{pass}}
